import 'package:flutter/material.dart';

class GradientFilledButton extends StatelessWidget {
  const GradientFilledButton({super.key, this.onPressed, required this.text});

  final VoidCallback? onPressed;
  final String text;

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onPressed,
      child: Container(
        padding: const EdgeInsets.fromLTRB(13, 6, 13, 8),
        decoration: BoxDecoration(
          gradient: const LinearGradient(
            colors: [Color(0xff5D75FF), Color(0xff348EFF)],
            begin: Alignment.centerLeft,
            end: Alignment.centerRight,
          ),
          borderRadius: BorderRadius.circular(8), // 设置圆角
        ),
        child: Text(
          text,
          style: const TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.bold),
        ),
      ),
    );
  }
}
